function getbar(){
window.bar = echarts.init(document.getElementById("bar"));
bar.showLoading();

$.ajax({
	type : "post",
	url : $('body').attr('ctxPath') + '/report/visualization/getBar',
	data : "&startTime=" + M_ECharts_StartTime + "&endTime=" + M_ECharts_EndTime + "&project=" + M_ECharts_Project,
	dataType : "json",
	success : function(result) {
		barOption = {};
		barData =  {};
		if (result.state) {
			barData=result.data;
			barOption = {
					backgroundColor:'#fff',
				    title: {
				        text: "计划异常分析",
				        left: 0,
				        textStyle: {
				            color: '#000',
				            fontSize:  16
				        }
				    },
				    tooltip: {
				        trigger: "axis",
				        axisPointer: {
				            type: "shadow",
				            textStyle: {
				                color: "#fff"
				            }
				        },
				    },
				    toolbox: {
				    	 iconStyle: {
				             normal: {
				                 borderColor: '#fff'
				             },
				             emphasis: {
				             	 borderColor: '#000'
				             }
				         },
				        feature: {
				            restore: {
				                show: true
				            },
				            saveAsImage: {
				                show: true
				            }
				        }
				    },
				    grid: {
				        borderWidth: 0,
				        top: '10%',
				        bottom: '15%',
				        textStyle: {
				            color: "#000"
				        }
				    },
				    legend: {
				        top: '0',
				        textStyle: {
				            color: '#90979c',
				        },
				        data: ['计划正常', '计划异常', '总量'],
				        selected: {'计划正常': true, '计划异常': true, '总量': false}
				    },
				    calculable: true,
				    xAxis: [{
				        type: "category",
				        axisLine: {
				            lineStyle: {
				                color: '#90979c'
				            }
				        },
				        splitLine: {
				            show: false
				        },
				        axisTick: {
				            show: false
				        },
				        splitArea: {
				            show: false
				        },
				        axisLabel: {
				            interval: 0
				        },
				        data : ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
				    }],
				    yAxis: [{
				        type: "value",
				        splitLine: {
				            show: false
				        },
				        axisLine: {
				            lineStyle: {
				                color: '#90979c'
				            }
				        },
				        axisTick: {
				            show: false
				        },
				        axisLabel: {
				            interval: 0
				        },
				        splitArea: {
				            show: false
				        },
				    }],
				    dataZoom: {
				        height: "8%",
				        xAxisIndex: [0],
				        start: 0,
				        end: 100,
				        handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
				        handleSize: '110%',
				        handleStyle:{
				            color:"#d3dee5",
				        },
				         textStyle:{
				            color:"#fff"
				        },
				        borderColor:"#90979c"
				    },
				    series: [{
				            name: "计划正常",
				            type: "bar",
				            stack: "总量",
				            barMaxWidth: 35,
				            barGap: "10%",
				            itemStyle: {
				                normal: {
				                    color: "#69efa1",
				                    label: {
				                        show: true,
				                        textStyle: {
				                            color: "#fff"
				                        },
				                        position: "insideTop",
				                        formatter: function(p) {
				                            return p.value > 0 ? (p.value) : '';
				                        }
				                    }
				                }
				            },
				            data: barData.normal,
				        },

				        {
				            name: "计划异常",
				            type: "bar",
				            stack: "总量",
				            itemStyle: {
				                normal: {
				                    color: "#ec4f4f",
				                    barBorderRadius: 0,
				                    label: {
				                        show: true,
				                        position: "top",
				                        formatter: function(p) {
				                            return p.value > 0 ? (p.value) : '';
				                        }
				                    }
				                }
				            },
				            data: barData.exception
				        }, {
				            name: "总量",
				            type: "line",
				            stack: "总量",
				            symbol:'circle',
				            itemStyle: {
				                normal: {
				                    color: "#ecc24d",
				                    barBorderRadius: 0,
				                    label: {
				                        show: true,
				                        position: "top",
				                        formatter: function(p) {
				                            return p.value > 0 ? (p.value) : '';
				                        }
				                    }
				                }
				            },
				            data: barData.sum
				        },
				    ]
					};
			if (barOption && typeof barOption === "object") {
				bar.setOption(barOption, true);
				bar.hideLoading();
			}
		} else {
			layer.alert(data.msg);
		}
	},
	error : function() {
		console.log("网络错误，获取计划异常分析数据失败！");
		bar.hideLoading();
	}
});

}